dialogs: always use CSD on dialogs
authorWilliam Jon McCann <william.jon.mccann@gmail.com>
Thu, 27 Feb 2014 19:19:32 +0000 (14:19 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 3 Mar 2014 20:00:13 +0000 (15:00 -0500)
If we aren't using a header bar then put a fake titlebar
box on it so we can round the corners.

One of the advantages of this is so that the styling of the dialog
is completely within one theme framework. This prevents skew between
the theming expectations from the window manager and GTK+.

https://bugzilla.gnome.org/show_bug.cgi?id=725345

gtk/gtkdialog.c

index 8e5797fbaf4279ff1cb492bfc5d90480d0cf86aa..37d9bf0bce07d5408d93de18db94b9d3895a5a30 100644 (file)
@@ -279,7 +279,18 @@ apply_use_header_bar (GtkDialog *dialog)
   gtk_widget_set_visible (priv->action_area, !priv->use_header_bar);
   gtk_widget_set_visible (priv->headerbar, priv->use_header_bar);
   if (!priv->use_header_bar)
-    gtk_window_set_titlebar (GTK_WINDOW (dialog), NULL);
+    {
+      GtkWidget *box = NULL;
+
+      if (gtk_window_get_type_hint (GTK_WINDOW (dialog)) == GDK_WINDOW_TYPE_HINT_DIALOG)
+        {
+          box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+          gtk_widget_show (box);
+          gtk_widget_set_size_request (box, -1, 16);
+        }
+
+      gtk_window_set_titlebar (GTK_WINDOW (dialog), box);
+    }
   if (priv->use_header_bar)
     g_signal_connect (priv->action_area, "add", G_CALLBACK (add_cb), dialog);
 }